home *** CD-ROM | disk | FTP | other *** search
- Path: news.uh.edu!usenet
- From: Sensarn <txs53132@bayou.uh.edu>
- Newsgroups: comp.lang.c++
- Subject: Re: Any responsible people here ?-) Help w/EGA/VGA
- Date: 4 Feb 1996 23:28:25 GMT
- Organization: AEtna Insurance Agency
- Message-ID: <4f3fep$snd@masala.cc.uh.edu>
- References: <4f0a32$dce@news1.usa.pipeline.com>
- NNTP-Posting-Host: sip-14286.public-dialups.uh.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1 (Windows; U; 16bit)
-
- The video buffer is located at A000:0000. Set up a pointer to access
- it easily:
-
- unsigned char far *video_buffer=(unsigned char far *)0xA0000000;
-
- Plane switching is done through I/O port 3C4h (takes words). A linear
- mode, such as mode 13h, doesn't use planes (all planes are chained
- together creating a byte-per-pixel system). Mode x plane switching works
- like the following:
-
- outp(0x3C4,2); //Function 2 -- Change Plane
- outp(0x3C5,plane); //Send plane value
-
- The 'plane' variable holds a nibble containing the plane data:
-
- 0000 = 0 = NO PLANES
- 0001 = 1 = PLANE 1
- 0010 = 2 = PLANE 2
- 0100 = 4 = PLANE 3
- 1000 = 8 = PLANE 4
- 0011 = 3 = PLANES 1 AND 2
- 0101 = 5 = PLANES 1 AND 3
- 1001 = 9 = PLANES 1 AND 4
- 0110 = 6 = PLANES 2 AND 3
- 1010 = 10 = PLANES 2 AND 4
- 1100 = 12 = PLANES 3 AND 4
- 0111 = 7 = PLANES 1, 2 AND 3
- 1011 = 11 = PLANES 1, 2, AND 4
- 1101 = 13 = PLANES 1, 3 AND 4
- 1110 = 14 = PLANES 2, 3, AND 4
- 1111 = 15 = PLANES 1, 2, 3, AND 4
-
- As you can see, the port gives the programmer the ability to select a
- single plane or any combinations of the four.
-
- Screen modes such as 12h use color planes:
-
- outp(0x3C4,2); //Function 2 -- Change Plane
- outp(0x3C5,color); //Change color
-
- The 'color' variable holds the color plane value (0-15). In this mode
- (640x480x16), pixels are drawn up to eight at a time. For example, if
- you wan't to light up the first eight pixels (0,0-7,0) with yellow (color
- index 14), you would write a 255 to the video buffer address 0 and send
- the value '14' to the I/O port.
-
- Steven Sensarn - txs53132@bayou.uh.edu
-
-